﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SmartEP.DataService;
using SmartEP.DTO;

namespace SmartEP.Presenter
{
    public class DatabasePresenter
    {
        private IDatabase _database;
        private DatabaseService _services;

        public DatabasePresenter(IDatabase database)
        {
            this._database = database;
            this._services = new DatabaseService();
        }
        public DatabasePresenter()
        {
            this._services = new DatabaseService();
        }

        public System.Collections.ArrayList ReadDatabaseXML(string FileName)
        {
            return _services.ReadDatabaseXML(FileName);
        }

        public void WriteDatabaseXML(string FileName)
        {
            Database database = new Database(_database.ServerName, _database.DatabaseName, _database.UserName, _database.Password);
            _services.WriteDatabaseXML(FileName, database);
        }
    }
}
